oracle

推荐列表 站点导航

当前位置:首页 > 数据库 > oracle >

oracle 存储过程和函数例子

来源:网络整理  作者:  发布时间:2020-12-15 18:19
本文没有对PL/SQL中的东西有什么说明,只是简单的举了几个例子,希望对大家有用!...
end case ;
dbms_output.put_line(stu_name|| course_name);
stu_name varchar2(100);
begin
end;
begin
---关于游标 for,case 的例子2
dbms_output.put_line(c_n);
end loop;
end loop;
return number
begin
case
begin
then
end;

dbms_output.put_line('feng la feng la ');
is
dbms_output.put_line('Stu_name = '||temp.stu_name);
dbms_output.put_line(temp );
error EXCEPTION;
sum1 number := 0;
as
end;
open var_cur;
end loop;
is
return number;
end;
else
---关于异常处理的例子
c_n varchar2(100);
end;
then
dbms_output.put_line(sum1 );
create or replace procedure loop_cur
when 1 then
Dbms_Output.put_line('c_n' || c_n);
course_name varchar2(100);
when 3 then
dbms_output.put_line('haha4');
begin
---关于异常处理的例子2
end loop;
then
dbms_output.put_line('try');
end;
create or replace procedure peace_insert ( c_n in varchar2)
end loop;
insert into course (course_name) values (c_n);
close var_cur;
end;
dbms_output.put_line('haha3');
create or replace procedure peace_loop
if c_n = 'OK'
is
create or replace procedure peace_if
exception
begin
procedure test2 (in2 in varchar2);
dbms_output.put_line('haha3');
create or replace package peace_pkg
procedure test2 (in2 in varchar2)
dbms_output.put_line('haha1');
for temp in var_c loop

is
commit;
end if;
exit when temp >= 10 ;
begin
elsif c_n = 'NG' then
begin
create or replace procedure peace_for
function test1(in1 in varchar2)
when temp.vol=3 then
for temp in var_c loop
dbms_output.put_line('qita');
select course_name into c_n from grade where stu_name = in1;
dbms_output.put_line('haha4');
end;
function test1(in1 in varchar2)
end peace_pkg; exit when var_cur%notfound;
dbms_output.put_line('haha2');
end case ;
fetch var_cur into stu_name,course_name;
begin
---关于包的例子 定义包体
cursor var_c is select * from test_case;
when temp.vol=2 then
loop
create or replace procedure peace_case2
elsif temp.course_name = 'DB' then
sum1 := sum1+temp;
end;
dbms_output.put_line('more');
temp := temp +1;
raise error;
exception
as
sum1 number :=0;
end loop;
temp := temp||to_char(i) || ' * ' ||to_char(j) ||' = ' ||to_char(sum1) ||' ';
dbms_output.put_line('haha1');
---关于 loop循环的例子
temp number :=0 ;
---关于游标 for,case 的例子1
begin
create or replace package body peace_pkg
is
is
for i in 1..9 loop
cursor var_c is select * from test_case;
temp := '';
when 4 then
end loop;
---关于for 循环的例子
---关于包的例子 定义包
when error then
else
when temp.vol=4 then
dbms_output.put_line('qita');
rollback;
when TOO_MANY_ROWS
end if;
create or replace procedure peace_exp(in1 in varchar2)
temp := 0;
if temp.course_name = 'OS' then
关于 游标 if,for 的例子
for j in 1 .. i
create or replace procedure peace_case1
dbms_output.put_line('haha2');
作者:peace.zhao
dbms_output.put_line(in2);
else
end peace_pkg;
cursor var_cur is select * from grade ;
return temp;
when 2 then
end;
temp varchar2(500);
sum1 := i * j;
when temp.vol=1 then
for temp in var_c loop
dbms_output.put_line('DB');
is
when no_data_found
loop
case temp.vol
is
cursor var_c is select * from grade;
loop
is
else
Dbms_Output.put_line('ERRO');
temp number;
insert into course (course_name) values (c_n);
---关于游标和loop循环的例子
as

相关热词: oracle

本站内容来源于网络,如有侵权请与我们联系,我们会及时删除,我们深感抱歉!
注:本站所有信息仅供用于网络技术学习参考,学习中请遵循相关法律法规!

本文地址: https://v30.fanwenzhu.com/sql/oracle/4205.shtml

Copyright © www.juheyunku.com      关于 | 合作 | 声明 | 联系 | 更新 | 地图 | Tags

oracle 存储过程和函数例子

2020-12-15 编辑:

end case ;
dbms_output.put_line(stu_name|| course_name);
stu_name varchar2(100);
begin
end;
begin
---关于游标 for,case 的例子2
dbms_output.put_line(c_n);
end loop;
end loop;
return number
begin
case
begin
then
end;

dbms_output.put_line('feng la feng la ');
is
dbms_output.put_line('Stu_name = '||temp.stu_name);
dbms_output.put_line(temp );
error EXCEPTION;
sum1 number := 0;
as
end;
open var_cur;
end loop;
is
return number;
end;
else
---关于异常处理的例子
c_n varchar2(100);
end;
then
dbms_output.put_line(sum1 );
create or replace procedure loop_cur
when 1 then
Dbms_Output.put_line('c_n' || c_n);
course_name varchar2(100);
when 3 then
dbms_output.put_line('haha4');
begin
---关于异常处理的例子2
end loop;
then
dbms_output.put_line('try');
end;
create or replace procedure peace_insert ( c_n in varchar2)
end loop;
insert into course (course_name) values (c_n);
close var_cur;
end;
dbms_output.put_line('haha3');
create or replace procedure peace_loop
if c_n = 'OK'
is
create or replace procedure peace_if
exception
begin
procedure test2 (in2 in varchar2);
dbms_output.put_line('haha3');
create or replace package peace_pkg
procedure test2 (in2 in varchar2)
dbms_output.put_line('haha1');
for temp in var_c loop

is
commit;
end if;
exit when temp >= 10 ;
begin
elsif c_n = 'NG' then
begin
create or replace procedure peace_for
function test1(in1 in varchar2)
when temp.vol=3 then
for temp in var_c loop
dbms_output.put_line('qita');
select course_name into c_n from grade where stu_name = in1;
dbms_output.put_line('haha4');
end;
function test1(in1 in varchar2)
end peace_pkg; exit when var_cur%notfound;
dbms_output.put_line('haha2');
end case ;
fetch var_cur into stu_name,course_name;
begin
---关于包的例子 定义包体
cursor var_c is select * from test_case;
when temp.vol=2 then
loop
create or replace procedure peace_case2
elsif temp.course_name = 'DB' then
sum1 := sum1+temp;
end;
dbms_output.put_line('more');
temp := temp +1;
raise error;
exception
as
sum1 number :=0;
end loop;
temp := temp||to_char(i) || ' * ' ||to_char(j) ||' = ' ||to_char(sum1) ||' ';
dbms_output.put_line('haha1');
---关于 loop循环的例子
temp number :=0 ;
---关于游标 for,case 的例子1
begin
create or replace package body peace_pkg
is
is
for i in 1..9 loop
cursor var_c is select * from test_case;
temp := '';
when 4 then
end loop;
---关于for 循环的例子
---关于包的例子 定义包
when error then
else
when temp.vol=4 then
dbms_output.put_line('qita');
rollback;
when TOO_MANY_ROWS
end if;
create or replace procedure peace_exp(in1 in varchar2)
temp := 0;
if temp.course_name = 'OS' then
关于 游标 if,for 的例子
for j in 1 .. i
create or replace procedure peace_case1
dbms_output.put_line('haha2');
作者:peace.zhao
dbms_output.put_line(in2);
else
end peace_pkg;
cursor var_cur is select * from grade ;
return temp;
when 2 then
end;
temp varchar2(500);
sum1 := i * j;
when temp.vol=1 then
for temp in var_c loop
dbms_output.put_line('DB');
is
when no_data_found
loop
case temp.vol
is
cursor var_c is select * from grade;
loop
is
else
Dbms_Output.put_line('ERRO');
temp number;
insert into course (course_name) values (c_n);
---关于游标和loop循环的例子
as

本站内容来源于网络,如有侵权请与我们联系,我们会及时删除,我们深感抱歉!
注:本站所有信息仅供学习参考!
本文地址为 https://v30.fanwenzhu.com/sql/oracle/4205.shtml

相关文章

风云图片

推荐阅读

返回oracle频道首页